Certain computer graphics applications include a stenciling function for protecting part of an image from subsequent paint strokes. A stenciling function allows a user to select a region of the image to protect, such that subsequent paint strokes falling within the selected region are not blended into the image.
A stenciling function may also allow a user to apply a partial mask to a selected region, such that a subsequent paint stroke falling within the selected region is only partially blended into the image. For example, a partial mask may be used along the edges of a full mask in order to provide a smooth transition between masked and unmasked portions of the stenciled image.
A partial mask may be applied for a single paint stroke falling within a selected region by reducing the intensity of the paint stroke prior to blending the paint stroke into the image. Partial masks that are available in current graphics applications are of limited value where paint strokes overlap. Overlapping paint strokes within a partially masked region may result in a blending of more color into the underlying image than is desired.
Paint strokes within a partially stenciled region are blended into an image one by one, as soon as each paint stroke is executed. The color contributed by the original layer appears to diminish as new layers of paint are blended into the partially-stenciled region. That is, the opacity of the original layer decreases as the image is layered over with new paint.
It is not possible for a user to specify that an initial version of a selected region of an image be maintained at a specified opacity in any subsequent composite. This is because the image is modified after each stroke in order to maintain real-time interactivity with the user, and previous brush strokes are not accounted for in the attenuation and blending of subsequent, overlapping strokes.
Similarly, overlapping erase strokes within a partially-masked region may result in a removal of more color than is desired by the user, since overlapping erase strokes in the selected region will eventually reduce the opacity of the original layer below the desired minimum.
Furthermore, current methods of blending individual paint strokes into an image may result in undesired artifacts. An individual paint stroke is generally divided into a series of stroke segments that are separately blended into an image. Overlapping portions at the ends of segments of an individual paint stroke are blended twice, causing undesired artifacts.
There exists a general need for more accurate and more robust stenciling methods in computer graphics applications. More specifically, there exists a need for stenciling methods that allow a user to specify that a selected region not change more than a specified amount during subsequent editing.